import { Input } from 'antd'
import React, { forwardRef } from 'react'
/* 
import CustomTextArea from '@/components/antd-comp/input/CustomTextArea'

const [value, setValue] = useState('')

<CustomTextArea
  value={value}
  onChange={e => setValue(e.target.value)}
  placeholder="xxx"
  rows={4}
></CustomTextArea>
*/

const { TextArea } = Input
// 定义文本区域的属性类型
interface CustomTextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
  autoSize?: boolean | { minRows?: number; maxRows?: number }
  // 可以在这里添加自定义属性，如果需要的话
}

const CustomTextArea = forwardRef<HTMLTextAreaElement, CustomTextAreaProps>(({ className, ...props }: any, ref) => (
  <TextArea className={className} ref={ref} {...props} />
))

export default CustomTextArea
